from typing import Optional

from fastapi_amis_admin.models import Field

from ..common import AppBaseModel


class SysBasicFile(AppBaseModel, table=True):
    __tablename__ = 'sys_basic_file'
    __table_args__ = {'extend_existing': True}
    file_id: Optional[str] = Field(title='文件id',
                                    serialization_alias="fileId",
                                   validation_alias="fileId",
                                   alias="fileId")
    name: Optional[str] = Field(title='文件名')
    origin_name: Optional[str] = Field(title='原始文件名',
                                      alias="originName",
                                      serialization_alias="originName",
                                      validation_alias="originName")
    size: Optional[int] = Field(title='大小')
    relative_path: Optional[str] = Field(title='文件相对路径',
                                       serialization_alias="relativePath",
                                         validation_alias="relativePath",
                                         alias="relativePath")
    relative_url: Optional[str] = Field(title='文件相对url',
                                       serialization_alias="relativeUrl",
                                        validation_alias="relativeUrl",
                                        alias="relativeUrl")

